<?php

namespace App\Http\Requests;

class UpdateOtherAmountRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            "*" => [
                'required',
                function ($attribute, $value, $fail) {
                    if ($value < 0 && $attribute != "_token") {
                        return $fail('金额不能为负数');
                    }
                }
            ]
        ];
    }
}
